import React from 'react'
import AgentService from '@/modules/Agent';
import styled from '@emotion/styled';
import { Dropdown, MenuProps } from 'antd';
import Icon from '@/components/Icon';
import Setting from '../Setting';

const DetailDropdown = styled(Dropdown)`
	.ant-dropdown-menu {
		border-radius: 10px;
	}
`;




const UserConfigDropdown = (props: { setSettingVisible: (status: boolean) => void, chooseMenu: (menu: any) => void }) => {
    const { configure } = AgentService;
    const items: MenuProps['items'] = [

        {
            label: <Setting chooseMenu={props.chooseMenu} />,
            key: '1',
        },

    ];
    return (
        <>
            {/* 用户名称 */}
            < DetailDropdown placement="bottom" getPopupContainer={() => AgentService.rootContainer} menu={{ items }} trigger={['click']} overlayClassName="user-info-detail-dropdown" >
                <span
                    className="setting"
                    id="setting-menu"
                    onClick={e => {
                        e.preventDefault();
                        e.stopPropagation();
                        props.setSettingVisible(false);
                    }}
                >
                    <Icon classname="icon-widget-shezhi"></Icon>
                </span>
            </DetailDropdown >
        </>
    )
}

export default UserConfigDropdown